<!--
 * @Author: your name
 * @Date: 2021-03-24 09:42:08
 * @LastEditTime: 2021-03-24 09:52:24
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \js_leetcode\event.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="a">
        <button id="b"></button>

    </div>

    <script>
        let b = document.querySelector("#b")
        b.addEventListener("click", handleClick)
        function handleClick() {
            alert("hello world")
        }
        console.log();
    </script>
</body>

</html>